package net.jarang.study.spring.web;

import java.util.List;

import net.jarang.study.spring.UrlMapping;

import org.springframework.stereotype.Component;

@Component
public class ScoreController {
	@UrlMapping("sum")
	public int sum(List<Integer> scores) {
		int sum = 0;
		if (scores != null) {
			for (Integer each : scores) {
				sum += each;
			}
		}
		return sum;
	}
	
	@UrlMapping("hello")
	public String hello(String id) {
		return "Hello " + id;
	}
}
